// 数据配置
const datas = {
	preview_color: {
		title: "搜索栏背景",
		type: "bg",
		value: {
			isColor: '1',
			color: "#ffffff",
			image: ""
		}
	},
	show_code: {
		title: '二维码是否显示',
		type: 'switch',
		value: false,
	},
	code_color: {
		title: '二维码颜色',
		type: 'color',
		value: '#666666',
	},
	show_saoma: {
		title: '扫一扫(仅适用于聚合app)',
		type: 'switch',
		value: false,
	},
	saoma_color: {
		title: '二维码颜色',
		type: 'color',
		value: '#666666',
	},
	search_page: {
		title: "搜索页面",
		type: "radio",
		value: "1",
		options: [
			{label: "平台商品", value: "1"}
		]
	},
	search_type: {
		title: "搜索商品类型",
		type: "radio",
		value: "shop",
		options: [
			{label: "平台商品", value: "shop"},
			{label: "门店商品", value: "store"},
		],
		showBy: 'search_page',
		showKey: '1',
	},
	search_style: {
		title: "搜索框样式",
		type: "radio",
		value: "1",
		options: [
			{label: "样式一", value: "1"},
			{label: "样式二", value: "2"},
		]
	},
	position_style: {
		title: "搜索框对齐方式",
		type: "radio",
		value: "left",
		options: [
			{label: "居左", value: "left"},
			{label: "居中", value: "center"},
		]
	},
	search_border_radius: {
		title: "搜索框圆角",
		type: "bar",
		value: 0,
		min: 0,
		max: 16,
	},
	font_size: {
		title: "字体大小",
		type: "bar",
		value: 14,
		min: 12,
		max: 24,
	},
	font_color: {
		title: '文字颜色',
		type: 'color',
		value: '#666666',
	},
	search_color: {
		title: "搜索框底色",
		type: "color",
		value: "#f3f2f2"
	},
	search_title: {title: "搜索框提示文字", type: "text", value: "店内搜索"},
	btn_font_color: {
		showBy: 'search_style',
		showKey: '2',
		title: '搜索按钮文字颜色',
		type: 'color',
		value: '#666666',
	},
	btn_bg_color: {
		showBy: 'search_style',
		showKey: '2',
		title: "搜索按钮底色",
		type: "color",
		value: "#f3f2f2"
	},
	search_height: {
		title: "搜索栏高度",
		type: "bar",
		value: 50,
		min: 40,
		max: 70,
	},
	border_style: {
		title: "搜索框边框是否显示",
		type: "radio",
		value: "0",
		options: [
			{label: "是", value: "1"},
			{label: "否", value: "0"},
		]
	},
	is_top_fixed: {
		title: "搜索框是否滑动到顶部吸附置顶（小程序无效）",
		type: "radio",
		value: "0",
		options: [
			{label: "是", value: "1"},
			{label: "否", value: "0"},
		]
	},
	border_color: {
		title: "边框颜色",
		type: "color",
		value: "#333333"
	},
};

// 样式配置
const styles = {};

import template1 from './template1';

import store from '../../../../store/index'
let component_list = store.state.design.component_list.componentList || [];
if(component_list.indexOf('U_webDesign') > -1){
	datas.search_page.options.push({
		label: "页面设置搜索页", value: "2"
	})
}
if(component_list.indexOf('U_couponStore') > -1){
	datas.search_page.options.push({
		label: "消费券搜索页", value: "3"
	})
}

export const config = {
	datas,
	styles,
	layout: [
		template1
	]
};
